<template>
    <div style="width:100%px;height:71px; margin-top: 1px;margin-bottom: 2px;" class="taskitemcontainer">
        <div class="taskleft">
            <img class="leftarrow" src="../img/img_left_arrow.png" v-if="selected"/>
        </div>
        <div class="taskitemmain" @click="btnClick" :class="{'tasknotselected':!selected,'taskselected':selected}">
            <div class="tasktitle">{{ title }}</div>
            <div class="tasksubtitle">{{ subtitle }}</div>
            <div class="taskicon" ></div>
        </div>
        <div style="width:6px;flex-shrink: 0;"></div>
    </div>
</template>
<script>
    export default {
        name: "TaskListItem",
        components: {},
        props: ["title","subtitle","selected","inputvalue"],
        data() {
            return {

            };
        },
        methods: {
            btnClick(){
                this.$emit("click");
            }
        },
        mounted() {

        },
        watch: {
            
        }
    };
</script>

<style scoped>



.taskitemcontainer{
    display: flex;
    flex-direction: row;

}   

.taskleft{
    width: 18px;
    height: 100%;
    flex-shrink: 0;
    position: relative;
}

.leftarrow{
    width: 8px;
    height: 16px;
    filter: drop-shadow(0px 0px 3px white);
    top: calc(50% - 8px);
    right: 0px;
    position: absolute;
    animation: arrowslash 800ms ease-in-out 0ms infinite;
}

@keyframes arrowslash {
    0%{
        transform: translateX(0px);
    }
    50%{
        transform: translateX(-4px);
    }
    100%{
        transform: translateX(0px);
    }
}

.taskitemmain{
    box-shadow: 0px 0px 2px 1px rgba(0,0,0, 0.25);
    transition-duration: 250ms;
    height: 100%;
    flex-grow: 1;
    position: relative;
}



.tasknotselected{
    transform: scaleX(0.97) scaleY(0.94);
    background-color: rgb(62, 72, 87);
    border: solid rgb(62, 72, 87) 2px;
}

.tasknotselected:hover{
    transform: scaleX(1) scaleY(1);
    background-color: rgb(62, 73, 88);
    border: solid rgb(204, 187, 153) 2px;
}

.taskselected{
    background-color: rgb(231, 223, 213);
    box-shadow: 0px 0px 3px 0px rgba(0,0,0, 0.25) inset;
    border: solid rgb(231, 223, 213) 2px;
}

.tasktitle{
    position: absolute;
    left: 24px;
    top: 7px;
    width: calc(100% - 80px);
    font-weight: bold;
    font-size: 20px;
    text-overflow:clip;
    white-space: nowrap;
}

.tasksubtitle{
    position: absolute;
    left: 25px;
    bottom: 10px;
    font-size: 15px;
    width: calc(100% - 80px);
    font-weight: 400;
    color: rgb(150, 153, 156);
    text-overflow:clip;
    white-space: nowrap;
}

.taskselected>.tasktitle{
    color: rgb(75, 83, 102);
}



.tasknotselected>.tasktitle{
    color: rgb(237, 229, 218);
}

.taskicon{
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(161, 146, 131, 0.377);
    mask-size: 100%;
    -webkit-mask-size: 100%;
    mask-image:url(/img/ic_track.png);
    -webkit-mask-image:url(/img/ic_track.png);
    border-image-repeat: round;
    right: 24px;
    top: calc(50% - 20px);
}


</style>